Move the wrapper cursors to the cursor module - #823
Merged
Conversation
The `enter` wrapper had two halves. One presents a wrapped trace and batch, rewriting descriptions and compaction frontiers through `Refines`; it names no keys and no values. The other navigates the wrapped batch with a cursor. This moves the second half to `trace/cursor/wrappers/enter.rs`, leaving `trace/wrappers/enter.rs` free of any cursor mention. A reader who declines cursors keeps the wrapper and supplies its own module beside this one. The cursor reaches the wrapped batch through a new `inner()` accessor. It sits in its own unbounded impl block because the `Cursor` impl does not know that the wrapped storage is a `BatchReader`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
As with `enter`, the wrapper splits into a half that presents a wrapped trace and batch and a half that navigates it. The second half moves to `trace/cursor/wrappers/frontier.rs`. The time semantics stay with the batch, as `advance_time`, which advances a time by `since` and reports whether `until` suppresses it. Any reader of the wrapped batch applies that rule, whether or not it reads through a cursor. The cursor no longer keeps its own copies of the two frontiers, so it holds nothing but the cursor it forwards to. Its bound strengthens to `Storage: BatchReader<Time = C::Time>`, which is what lets it hand its owned time to the batch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`advance_time` borrowed `since` from the batch on every time it advanced. The borrow is a slice construction and the comparisons are unchanged, but it put a call boundary inside the per-update closure, where the prior code hoisted both frontiers above it. The batch now lends its frontiers as an `Advance`, which a reader acquires once and applies to each time. The semantics still belong to the batch, so a reader that does not use cursors still gets them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This reverts commit 2960609. The borrowed frontiers are `Antichain<Time>`, never a time container, so borrowing one per time costs a slice construction from an inlined method rather than anything a container layout could make expensive. The `Advance` type was not worth its own name. `advance_time` keeps an `#[inline]`, matching the forwarders around it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate the cursor-specific aspects of traces wrappers (enter and frontier) from their definitions to a
cursor/wrappersmodule, as part of relocating as much cursor-specific content to be literally cursor adjacent, rather than throughout the codebase.